package com.aku.service.impl;

import com.aku.mapper.BookMapper;
import com.aku.pojo.Book;
import com.aku.service.BookService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BookServiceImpl implements BookService {

    @Resource
    private BookMapper bookMapper;

    @Override
    public List<Book> findAllBook() {
        List<Book> books = bookMapper.selectAllBook();
        return books;
    }

    public boolean addBook(Book book){
        int num = bookMapper.insertBook(book);
        return num > 0;
    }
}
